package com.happyclub.pojo;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Time;
import java.util.Objects;

/**
 * @author 高欢
 * @description 相册相片表
 * @date 2019/4/4
 */
@Entity
@Table(name = "TB_ALBUM_PHOTO_MAP", schema = "SCOTT")
@IdClass(TbAlbumPhotoMapPK.class)
@EntityListeners(AuditingEntityListener.class)
public class TbAlbumPhotoMap implements Serializable {
    private String photoAlbumId;
    private String photoId;
    private Time updateTime;
    private Time createTime;

    @Id
    @Column(name = "PHOTO_ALBUM_ID")
    public String getPhotoAlbumId() {
        return photoAlbumId;
    }

    public void setPhotoAlbumId(String photoAlbumId) {
        this.photoAlbumId = photoAlbumId;
    }

    @Id
    @Column(name = "PHOTO_ID")
    public String getPhotoId() {
        return photoId;
    }

    public void setPhotoId(String photoId) {
        this.photoId = photoId;
    }

    @Basic
    @Column(name = "UPDATE_TIME")
    public Time getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Time updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    public Time getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Time createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbAlbumPhotoMap that = (TbAlbumPhotoMap) o;
        return Objects.equals(photoAlbumId, that.photoAlbumId) &&
                Objects.equals(photoId, that.photoId) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(photoAlbumId, photoId, updateTime, createTime);
    }
}
